package com.java.netty.common.codec;

import java.util.List;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;

public class VncDecoder extends ByteToMessageDecoder {

   @Override
   protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
      int dataLen = in.readInt();
      VncPacket vncPacket = new VncPacket();
      vncPacket.decode(in);
      out.add(vncPacket);
   }
}
